/**
 * Copyright (c) 2002-2011 旭鸣信息
 * All rights reserved. 
 * File：CouponService.java
 * History:
 *       Apr 16, 2012: Initially created, liuzhi.
 */
package com.xteam.ecsystem.service.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xteam.ecsystem.dao.ICouponDao;

/**
 * 购物券业务管理层
 * @author liuzhi
 *
 */
@Service
public class CouponService {
	
	@Autowired
	private ICouponDao couponDao;
	
	/**
	 * 
	 * 新增或者修改购物券信息
	 * @author liuzhi
	 * @param obj
	 * @param id
	 */
	public void saveOrUpdateObject(Object obj, String id){
		this.couponDao.saveOrUpdateObject(obj, id);
	}
	
	/**
	 * 
	 * 条件查询和分页显示购物券信息
	 * @author liuzhi
	 * @param index
	 * @param size
	 * @param newsTitle
	 * @param newsTime
	 * @return
	 */
	public String getCouponList(int pageIndex, int pageSize, String bciName, String bciState){
		return this.couponDao.getCouponList(pageIndex, pageSize, bciName, bciState);
	}

	/**
	 * 根据购物券编号获得对应的购物券信息
	 * @author liuzhi
	 * @param id
	 * @return
	 */
	public String getCouponInfoById(String id){
		return this.couponDao.getCouponInfoById(id);
	}
	
	/**
	 * 
	 * 根据购物券编号修改购物券状态
	 * 0：无效
	 * 1：有效
	 * @author liuzhi
	 * @param id
	 */
	public void updateCouponStateById(String id){
		this.couponDao.updateCouponStateById(id);
	}

	/**
	 * 批量删除购物券
	 * @author liuzhi Oct 18, 2013
	 * @param bciIds
	 */
	public void delCouponByIds(String bciIds) {
		this.couponDao.delCouponByIds(bciIds);
	}
}
